<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="blog/index/include_blog::header"></head>
<link th:href="@{/css/plugins/bigger-picture/bigger-picture.css}" rel="stylesheet" type="text/css">
<body>
	<nav th:include="blog/index/include_blog::nav"  class="navbar navbar-default navbar-custom navbar-fixed-top" ></nav>
	<!-- Page Header -->
	<header class="intro-header"
		style="background-image: url('/img/blog/post-bg.jpg')">
		<div class="container">
			<div class="row">
				<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
					<div class="post-heading">
						<h1 th:text="${bContent.title}"></h1>
						<span class="meta">作者 <a href="#"
							th:text="${bContent.author}"></a>&nbsp;&nbsp;<a href="#"
							th:text="${gtmModified}"></a>
						</span>
					</div>
				</div>
			</div>
		</div>
	</header>

	<!-- Post Content -->
	<article>
		<div class="container">
			<div class="col-sm-12">
				<div id="content" class="summernote"></div>
			</div>
			<div class="col-sm-1 columns pull-right">
				<div id="downLoadCodeDiv">

				</div>
			</div>
		</div>
	</article>
	<hr>
	<div th:include="blog/index/include_blog::footer"></div>
	<script th:src="@{/js/plugins/axios/axios.min.js}"></script>
	<script th:src="@{/js/plugins/bigger-picture/bigger-picture.min.js}"></script>
	<script type="text/javascript" th:inline="javascript">

		/***************************** BiggerPicture相关（开始） ******************************/
		let bp = BiggerPicture({
			target: document.body,
		})

		let imageLinks = null;

		function openGallery(e) {
			e.preventDefault()
			bp.open({
				items: imageLinks,
				el: e.currentTarget,
			})
		}
		/***************************** BiggerPicture相关（结束） ******************************/


		$().ready(function() {
			$('.summernote').summernote({
				lang : 'zh-CN'
			});
			var content = [[${bContent.content}]]
			let cid = [[${bContent.cid}]];
			$('#content').code(content);
			$('.summernote').destroy();
			if([[${bContent.sourceCode}]] != null) {
				// 隐藏下载源码按钮
				$("#downLoadCodeDiv").html('<a class="btn btn-success" id="downLoadCode" target="_blank" href=\'/blog/open/download/' + cid + '\' >下载源码</a>')
			}

			/***************************** BiggerPicture相关（开始） ******************************/
			imageLinks = document.querySelectorAll('.biggerPicture_image > a');
			for (let link of imageLinks) {
				link.addEventListener("click", openGallery);
			}
			/***************************** BiggerPicture相关（结束） ******************************/

		});

	</script>
</body>
</html>
